//
//  NiWenListCell.m
//  LaSaCivilAffairsDepartment
//
//  Created by 姜晓延 on 2019/8/19.
//  Copyright © 2019 wpkj. All rights reserved.
//

#import "NiWenListCell.h"

@implementation NiWenListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (IBAction)xuanzhongBtn:(UIButton *)sender {
    
    if (!sender.selected) {
        if (self.xuanzhongbtnclicked) {
            self.xuanzhongbtnclicked(sender.selected);
        }
        sender.selected = !sender.selected;
    }
}
- (void)configDict:(NSDictionary *)dict{
    self.contentDict = dict;
    self.fileTitleLabel.text = [ValidateUtils validateNull:dict[@"fileTitle"]];
    self.fileReasonLabel.text = [ValidateUtils validateNull:dict[@"fileReason"]];
    if ([[ValidateUtils validateNull:dict[@"bpmStatus"]] isEqualToString:@"1"]) {
        self.bpmStatusLabel.text = @"待提交";
    }else if ([[ValidateUtils validateNull:dict[@"bpmStatus"]] isEqualToString:@"2"]){
        self.bpmStatusLabel.text = @"处理中";
    }else if ([[ValidateUtils validateNull:dict[@"bpmStatus"]] isEqualToString:@"3"]){
      
        if ([[ValidateUtils validateNull:dict[@"archive"]] isEqualToString:@"1"]) {
              self.bpmStatusLabel.text = @"已归档";
        }else{
              self.bpmStatusLabel.text = @"已完成";
        }
    }
    if ([dict[@"isSelect"] isEqualToString:@"1"]) {
        self.chooseBtn.selected = YES;
    }else{
        self.chooseBtn.selected = NO;
    }
}
- (void)configYueBanDict:(NSDictionary *)dict{
    self.contentDict = dict;
    self.fileTitleLabel.text = [ValidateUtils validateNull:dict[@"fileTitle"]];
    self.fileReasonLabel.text = [ValidateUtils validateNull:dict[@"fileCode"]];
    if ([[ValidateUtils validateNull:dict[@"bpmStatus"]] isEqualToString:@"1"]) {
        self.bpmStatusLabel.text = @"待提交";
    }else if ([[ValidateUtils validateNull:dict[@"bpmStatus"]] isEqualToString:@"2"]){
        self.bpmStatusLabel.text = @"处理中";
    }else if ([[ValidateUtils validateNull:dict[@"bpmStatus"]] isEqualToString:@"3"]){
          if ([[ValidateUtils validateNull:dict[@"archive"]] isEqualToString:@"1"]) {
                    self.bpmStatusLabel.text = @"已归档";
              }else{
                    self.bpmStatusLabel.text = @"已完成";
              }
    }
    if ([dict[@"isSelect"] isEqualToString:@"1"]) {
        self.chooseBtn.selected = YES;
    }else{
        self.chooseBtn.selected = NO;
    }
}
//yiban
- (void)configYiBanDict:(NSDictionary*)dict{
    self.contentDict = dict;
    self.fileTitleLabel.text = [ValidateUtils validateNull:dict[@"bpmBizTitle"]];
    self.fileReasonLabel.text = [ValidateUtils validateNull:dict[@"procDefName"]];
    self.bpmStatusLabel.text = [ValidateUtils validateNull:dict[@"name"]];
    CGSize size = [ self.bpmStatusLabel sizeThatFits:CGSizeMake(MAXFLOAT, 20)];
    if (size.width > ScreenWidth-50-100-20) {
        self.statusWidth.constant = ScreenWidth-50-100-20;
    }else{
        self.statusWidth.constant = size.width;
    }
    self.chooseBtn.hidden = YES;
}

- (void)configDaiBanDict:(NSDictionary*)dict{
    self.contentDict = dict;
    self.fileTitleLabel.text = [ValidateUtils validateNull:dict[@"bpmBizTitle"]];
    self.fileReasonLabel.text = [ValidateUtils validateNull:dict[@"definitionName"]];
    self.bpmStatusLabel.text = [ValidateUtils validateNull:dict[@"taskName"]];
    CGSize size = [ self.bpmStatusLabel sizeThatFits:CGSizeMake(MAXFLOAT, 20)];
    if (size.width > ScreenWidth-50-100-20) {
        self.statusWidth.constant = ScreenWidth-50-100-20;
    }else{
        self.statusWidth.constant = size.width;
    }
    if ([dict[@"isSelect"] isEqualToString:@"1"]) {
        self.chooseBtn.selected = YES;
    }else{
        self.chooseBtn.selected = NO;
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
